//
//  Path.m
//  taptap-server
//
//  Created by Michael Humphris on 18/09/11.
//  Copyright 2011 DTERC. All rights reserved.
//

#import "Path.h"

@implementation Path

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

+(NSString *)Combine:(NSString *)path1 path2:(NSString *)path2{
    NSString* dirSeparator = @"/";
    if (![path1 hasSuffix:dirSeparator]) {
        path1 = [NSString stringWithFormat:@"%@%@",path1,dirSeparator];
    }    
    return [NSString stringWithFormat:@"%@%@",path1,path2];
}
+(NSString *)Combine:(NSString *)path1 path2:(NSString *)path2 path3:(NSString *)path3{
    path1 = [self Combine:path1 path2:path2];
    path1 = [self Combine:path1 path2:path3];
    return path1;
}
+(NSString *)Combine:(NSString *)path1 path2:(NSString *)path2 path3:(NSString *)path3 path4:(NSString *)path4{
    path1 = [self Combine:path1 path2:path2 path3:path3];
    path1 = [self Combine:path1 path2:path4];
    return path1;
}
@end
